package com.heima.behavior.controller;


import com.heima.behavior.service.UserReadService;
import com.heima.model.behavior.dtos.ReadDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1")
public class UserReadController {

    @Autowired
    private UserReadService userReadService;

    /**
     * 用户查查看文章后，增加文章阅读量，并保存到redis中
     * @param readDto
     * @return
     */
    @PostMapping("/read_behavior")
    public ResponseResult readArticleCount(@RequestBody ReadDto readDto){
        return userReadService.readArticleCount(readDto);
    }
}
